<div class="toolbar">
  <div class="toolbar-header">
    <%= "Appointment: #{@appointment.date_appointment} - #{@appointment.time_appointment.to_s(:time)} - #{@appointment.patient.full_name}" %>
  </div>
</div>

<ul class="nav nav-tabs">
  <li class="active"><a href="#detail" data-toggle="tab">Detail <%= t :appointment %></a></li>
  <li><a href="#diagnoses" data-toggle="tab"><%= t :diagnosis_records %></a></li>
  <li><a href="#treatments" data-toggle="tab"><%= t :treatment_records %></a></li>
  <li><a href="#prescriptions" data-toggle="tab"><%= t :prescription_records %></a></li>
</ul>

<!-- Tab panes -->
<div class="tab-content">
  <div class="tab-pane active" id="detail">
    <div class="row toolbar">
	  <div class="col-md-6">
		<span class="toolbar-header">
		  Detail <%= t :appointment %> 
		</span>
	  </div>
	  <div class="col-md-6 text-right">
		<ul class="toolbar-nav">
		  <li><%= link_to simple_icon("note"), edit_appointment_path(@appointment) %></li>
		  <li><%= link_to simple_icon("users"), appointments_path %></li>
		</ul>
	  </div>
	</div>
	<table class="table table-striped">
	  <tbody>
		<tr>
		  <td style="width: 200px"><strong><%= t :patients_name %></strong></td>
		  <td><%= link_to @appointment.patient.full_name, patient_path(@appointment.patient.id) %></td>
		</tr>
		<tr>
		  <td style="width: 200px"><strong><%= t :staff_incharge %></strong></td>
		  <td><%= link_to @appointment.staff.full_name, staff_path(@appointment.staff.id) %></td>
		</tr>
		<tr>
		  <td><strong><%= t :date_translate %></strong></td>
		  <td><%= @appointment.date_appointment %></td>
		</tr>
		<tr>
		  <td><strong><%= t :time_translate %></strong></td>
		  <td><%= @appointment.time_appointment.to_s(:time) %></td>
		</tr>
		<tr>
		  <td><strong><%= t :appointment_status %></strong></td>
		  <td><%= @appointment.appointment_status.label %></td>
		</tr>
		<tr>
		  <td><strong><%= t :registration_method %></strong></td>
		  <td><%= @appointment.registration_method.label %></td>
		</tr>
	  </tbody>
	</table>
  </div>
  
  <div class="tab-pane" id="diagnoses">
    <div class="row toolbar">
	  <div class="col-md-6">
		<span class="toolbar-header">
		  <%= t :diagnosis_records %>
		</span>
	  </div>
	  <div class="col-md-6 text-right">
		<ul class="toolbar-nav">
		  <li><%= link_to feather_icon('circle-plus'), new_appointment_diagnosis_path(:appointment_id => params[:id]) %></li>
		  <li><%= link_to simple_icon("users"), appointments_path %></li>
		</ul>
	  </div>
	</div>
	<table class="table table-striped">
	  <thead>
		<tr>
		  <th><%= t :actions  %></th>
		  <th>Label</th>
		  <th><%= t :diagnosis_group %></th>
		</tr>
	  </thead>

	  <tbody>
		<tr>
		  <%= render @appointment.diagnoses %>
		</tr>
	  </tbody>
	</table>
  </div>
  
  <div class="tab-pane" id="treatments">
    <div class="row toolbar">
	  <div class="col-md-6">
		<span class="toolbar-header">
		  <%= t :treatment_records %>
		</span>
	  </div>
	  <div class="col-md-6 text-right">
		<ul class="toolbar-nav">
		  <li><%= link_to feather_icon('circle-plus'), new_appointment_treatment_path(:appointment_id => params[:id]) %></li>
		  <li><%= link_to simple_icon("users"), appointments_path %></li>
		</ul>
	  </div>
	</div>
	<table class="table table-striped">
	  <thead>
		<tr>
		  <th><%= t :actions %></th>
		  <th>Label</th>
		  <th>Detail</th>
		  <th><%= t :treatment_group %></th>
		  <th>Fee</th>
		</tr>
	  </thead>

	  <tbody>
		<tr>
		  <%= render @appointment.treatments %>
		</tr>
	  </tbody>
	</table>
  </div>
  
  <div class="tab-pane" id="prescriptions">
    <div class="row toolbar">
	  <div class="col-md-6">
		<span class="toolbar-header">
		  <%= t :prescription_records %>
		</span>
	  </div>
	  <div class="col-md-6 text-right">
		<ul class="toolbar-nav">
		  <li><%= link_to feather_icon('circle-plus'), new_appointment_prescription_path(:appointment_id => params[:id]) %></li>
		  <li><%= link_to simple_icon("users"), appointments_path %></li>
		</ul>
	  </div>
	</div>
	<table class="table table-striped">
	  <thead>
		<tr>
		  <th><%= t :actions %></th>
		  <th><%= t :drug %></th>
		  <th><%= t :dosage %></th>
		  <th><%= t :quantity %></th>
		  <th><%= t :fee %></th>
		  <th><%= t :note %></th>
		</tr>
	  </thead>

	  <tbody>
		<tr>
			<%= render @appointment.prescriptions %></td>
		</tr>
	  </tbody>
	</table>
  </div>
</div>

